Repository navigation
Conversation
The static block that filled clientInternals made the class a side effect for esbuild, webpack and Bun. Define the accessors as a plain object. Co-authored-by: ochafik <ochafik@anthropic.com>
🦋 Changeset detectedLatest commit: b1394d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/core
@modelcontextprotocol/server
@modelcontextprotocol/server-legacy
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the
static {}block inClientwith a plain object, so esbuild, webpack and Bun can drop the class when an app does not use it. Draft, as a basis for discussion; stacked on #3254 for its test helper.Motivation and Context
The block added in #3047 (released in 2.4.0) counts as a side effect for those bundlers, so they keep
Clientand the JSON Schema validator. A bundle usingAppfrom@modelcontextprotocol/ext-appswent from 255 kB on 2.3.1 to 319 kB on 2.4.0 (esbuild, minified, zod included). Rollup and rolldown are not affected.On
mainalone this saves about 82 kB. On top of #3254 it saves nothing today, becauseClienthappens to sit in its own chunk. It stops the result depending on that chunking.How Has This Been Tested?
A new case in
treeShaking.test.tsbundles with annotations ignored; it fails before and passes after. Bun was checked by hand. Suites as described in #3254.Breaking Changes
None expected; see below.
Types of changes
Additional context
To discuss:
_-prefixed names inside its dependencies would breakext/skills. Acceptable, or is another shape preferred?Serverhas a similar static block, left alone here.Generated by Claude Code